﻿using System;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace dbpack
{
    [Serializable]
    public class script
    {
        [XmlAttribute] public string name;
        [XmlAttribute] public int sequence;
        [XmlText] public string body;
    }
    
    [Serializable]
    public class ver
    {
        private readonly List<script> scripts_ = new List<script>();
        
        [XmlAttribute] public string name;

        [XmlArray("scripts")]
        [XmlArrayItem("script")]
        public List<script> scripts
        {
            get { return scripts_; }
        }
    }

    [Serializable]
    public class pack
    {
        private readonly List<ver> vers_ = new List<ver>();
      
        public string project;
        public string pack_versions;
        public string project_versions;

        public string on_date;
        public Guid id;

        [XmlArray("vers")]
        [XmlArrayItem("ver")]
        public List<ver> vers
        {
            get { return vers_; }
        }
    }
}
